Skip to content

Add Nix flake for Warp#9394

Open
VitalyAnkh wants to merge 4 commits intowarpdotdev:masterfrom
VitalyAnkh:fix/9296-nix-flake
Open

Add Nix flake for Warp#9394
VitalyAnkh wants to merge 4 commits intowarpdotdev:masterfrom
VitalyAnkh:fix/9296-nix-flake

Conversation

@VitalyAnkh
Copy link
Copy Markdown

@VitalyAnkh VitalyAnkh commented Apr 29, 2026

Follow-up context

This PR supersedes #9373. The earlier PR was automatically closed by the issue-readiness workflow after it was explicitly associated with the related issue before that issue had the ready-to-implement label. This PR carries the same Nix flake work forward and includes the follow-up review fixes from that thread: installing generated third-party license attribution and aligning bundled resources/settings schema with the stable public channel.

Description

Adds a first-party Nix flake for Linux users.

Fixes #9296

Platform scope

This flake currently supports Linux only (x86_64-linux and aarch64-linux). macOS support still requires separate packaging work and is not included in this PR.

What changed:

  • Adds flake.nix/flake.lock with packages.default and packages.warp-terminal for x86_64-linux and aarch64-linux.
  • Builds the OSS Warp Linux binary from source with the repository Rust toolchain and the release_bundle, gui, and nld_improvements features.
  • Installs bundled resources, generated stable-channel settings schema, generated third-party license attribution, desktop entry, icons, and licenses into the package output.
  • Uses the stable release channel when preparing bundled resources and settings metadata so the public Nix package does not include dogfood/preview-gated resources.
  • Patches only the resource helper script shebangs needed during packaging.
  • Wraps the executable with the runtime libraries needed on Nix systems.
  • Adds a matching devShell for Nix-based Rust development.

Testing

  • nix flake show --all-systems --no-write-lock-file
  • nix flake check --all-systems --no-build --print-build-logs
  • nix build .#warp-terminal --print-out-paths --print-build-logs
    • Built /nix/store/x0m983q27jkq70ydynz1i9dgvpkwcrk9-warp-terminal-0.1.0+b742d4e.
  • result/bin/warp-terminal --help
  • GUI smoke test with isolated HOME/XDG dirs: timeout 20s result/bin/warp-terminal stayed running until timeout (status=124).
  • Verified generated settings schema reports JSON Schema for Warp settings (stable channel, 185 settings).
  • Verified stable-channel bundled resources: 122 bundled files, 10 bundled skill directories, and no triage-vulnerabilities dogfood-gated skill in the package output.
  • Verified generated THIRD_PARTY_LICENSES.txt is installed under both opt/warpdotdev/warp-terminal/resources and share/licenses/warp-terminal, with matching contents.

Server API dependencies

No server API dependencies.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Changelog Entries for Stable

CHANGELOG-IMPROVEMENT: Added first-party Nix flake support for Linux users to build Warp from source.

Co-Authored-By: Warp agent@warp.dev

VitalyAnkh and others added 2 commits April 29, 2026 14:17
Adds a first-party Nix flake that builds the OSS Warp Linux binary from source, installs desktop assets and bundled resources, and exposes a development shell.

Co-Authored-By: Warp <agent@warp.dev>
Use the existing bundled-resource preparation script so the Nix package includes the generated THIRD_PARTY_LICENSES.txt in both bundled resources and share/licenses.
@cla-bot cla-bot Bot added the cla-signed label Apr 29, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 29, 2026

@VitalyAnkh

I'm starting a first review of this pull request.

I'm re-reviewing this pull request in response to a review request.

I requested changes on this pull request and posted feedback.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I requested changes on this pull request and posted feedback.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I approved this pull request. No matching stakeholder was found for the changed files, so no human reviewers were requested.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

You can view the conversation on Warp.

I approved this pull request. No matching stakeholder was found for the changed files, so no human reviewers were requested.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@VitalyAnkh
Copy link
Copy Markdown
Author

/oz-review

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds a Linux Nix flake and dev shell for building the OSS Warp binary, packaging resources, desktop metadata, icons, licenses, and runtime wrappers.

Concerns

  • The package builds warp-oss but generates bundled resources and the settings schema as the dev channel. In this repository, dev maps to dogfood-gated skills and enables release, preview, dogfood, and debug feature flags for schema generation, so the Nix output can ship internal/experimental assets and settings that should not be part of the OSS package.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread flake.nix Outdated
Comment on lines +184 to +190
SKIP_SETTINGS_SCHEMA=1 ./script/prepare_bundled_resources \
"${resourcesDir}" \
dev \
release

"$out/bin/generate_settings_schema" \
--channel dev \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This packages the OSS binary with dev-channel resources/schema; dev copies dogfood/preview-gated skills and generate_settings_schema enables DEBUG/DOGFOOD/PREVIEW flags, so the Nix package can expose internal/experimental assets and settings not intended for OSS users. Use an OSS/stable-equivalent channel for both resource copying and schema generation.

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds a Nix flake that builds and packages the OSS Warp Linux binary with bundled resources, desktop metadata, icons, license files, runtime wrappers, and a matching development shell.

Concerns

  • The package builds the OSS binary but prepares resources and the settings schema as the dev channel, which can expose dogfood-gated bundled resources and dev-only settings metadata in a public Nix package.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread flake.nix
Comment on lines +184 to +191
SKIP_SETTINGS_SCHEMA=1 ./script/prepare_bundled_resources \
"${resourcesDir}" \
dev \
release

"$out/bin/generate_settings_schema" \
--channel dev \
"${resourcesDir}/settings_schema.json"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This builds the public warp-oss binary but prepares resources and the settings schema as dev; that includes dogfood-gated skills via copy_conditional_skills and emits a dev/debug settings schema. Use a public channel here, or add explicit oss support before shipping this package.

Suggested change
SKIP_SETTINGS_SCHEMA=1 ./script/prepare_bundled_resources \
"${resourcesDir}" \
dev \
release
"$out/bin/generate_settings_schema" \
--channel dev \
"${resourcesDir}/settings_schema.json"
SKIP_SETTINGS_SCHEMA=1 ./script/prepare_bundled_resources \
"${resourcesDir}" \
stable \
release
"$out/bin/generate_settings_schema" \
--channel stable \
"${resourcesDir}/settings_schema.json"

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 29, 2026

@VitalyAnkh

I'm checking this implementation PR for association with a likely matching ready issue.

Powered by Oz

@VitalyAnkh
Copy link
Copy Markdown
Author

/oz-review

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds a first-party Nix flake for building and developing the Linux Warp OSS package, including pinned Nix inputs, vendored Cargo dependencies, resource/schema/license installation, wrapper setup, and a matching development shell.

Concerns

  • No blocking correctness or security concerns found in the inlined diff. The external Nix inputs and auxiliary source fetches are pinned by lockfile/hash, and the packaging steps are scoped to the new flake files.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@VitalyAnkh
Copy link
Copy Markdown
Author

/oz-review

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds a first-party Nix flake that builds and packages the OSS Warp Linux binary for x86_64-linux and aarch64-linux, including bundled resources, settings schema generation, license attribution, desktop metadata, icons, runtime wrapping, and a matching development shell.

Concerns

  • No blocking correctness or security concerns were found in the reviewed diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@VitalyAnkh
Copy link
Copy Markdown
Author

Context for maintainers: this PR supersedes #9373.

#9373 was the original submission for this Nix flake work, but it was automatically closed by the issue-readiness workflow after being explicitly associated with the related issue before that issue had the ready-to-implement label. I opened this follow-up PR to keep the contribution reviewable without using a closing keyword, and then carried over the fixes requested on the earlier thread:

  • generated third-party license attribution is installed into the package output;
  • bundled resources and settings_schema.json are generated using the stable public channel, so dogfood/preview-gated resources are not included;
  • packaging now only patches shebangs for the resource helper scripts used during postInstall.

Oz has approved this PR after those fixes.

@VitalyAnkh VitalyAnkh mentioned this pull request Apr 29, 2026
1 task
@captainsafia
Copy link
Copy Markdown
Collaborator

@VitalyAnkh Thanks for addressing all the rounds of feedback from Oz here! I've gone ahead and marked #9296 as ready-to-implement so that we can link it with this issue.

@acarl005 Can I tap you to review this?

@captainsafia captainsafia requested a review from acarl005 April 30, 2026 13:19
@captainsafia captainsafia added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Apr 30, 2026 — with Warp Dev Github Integration
@Eveeifyeve
Copy link
Copy Markdown

Eveeifyeve commented Apr 30, 2026

Question is does this actually build warp-terminal from source or does this build the schema? Because building warp from source requires more work including compiling the metalib seperately as xcrun doesn't actually allow compiling metal files to air. I have a feeling this is AI generated slop.

@VitalyAnkh
Copy link
Copy Markdown
Author

@Eveeifyeve What's the metalib? With this PR, I run:

nix build .#warp-terminal --print-out-paths --print-build-logs 
result/bin/warp-terminal --help

The compiled warp-termimal runs normally. You can run the command and verify the result.

I have a feeling this is AI generated slop.

I utilize AI but this is not AI generated slop.

@VitalyAnkh
Copy link
Copy Markdown
Author

VitalyAnkh commented May 1, 2026

@Eveeifyeve I rebuilt this locally. This PR builds the real Linux warp-oss app binary; it is not only building the schema generator.

You can verify by yourself. Evidence from nix build .#warp-terminal --print-out-paths --print-build-logs:

  • The flake currently targets Linux only: x86_64-linux and aarch64-linux.
  • Nix invokes Cargo with both the app binary and schema generator: -p warp --bin warp-oss --bin generate_settings_schema. The schema generator is built because settings_schema.json is packaged as a resource; it is not the only target.
  • The build log compiles warpui, warp_core, warp_terminal, and warp v0.1.0 (/build/source/app), then finishes the optimized release profile.
  • The package installs $out/bin/warp-oss into the app directory and exposes bin/warp-oss plus bin/warp-terminal wrapper symlinks: see the install/wrap step in flake.nix.
  • The final output contains opt/warpdotdev/warp-terminal/.warp-oss-wrapped; file reports it as an ELF x86-64 executable. Running result/bin/warp-terminal with an isolated HOME creates warp-oss.log, initializes app services, loads bundled skills, selects a GPU backend, and creates/saves app window state.

Repro:

nix build .#warp-terminal --print-out-paths --print-build-logs
file result/opt/warpdotdev/warp-terminal/.warp-oss-wrapped

tmp_home="$(mktemp -d)"
mkdir -p "$tmp_home/.config" "$tmp_home/.local/state"
HOME="$tmp_home" \
  XDG_CONFIG_HOME="$tmp_home/.config" \
  XDG_STATE_HOME="$tmp_home/.local/state" \
  timeout 20s result/bin/warp-terminal || true

tail -n 80 "$tmp_home/.local/state/warp-oss/warp-oss.log"

About metalib: that is macOS-specific. crates/warpui/build.rs only calls compile_metal_shaders() when CARGO_CFG_TARGET_OS == "macos", and the xcrun metal / xcrun metallib calls live under that path: crates/warpui/build.rs. app/build.rs also only links MetalKit inside the macOS branch: app/build.rs. So metalib is not expected to run for this Linux flake build.

I clarified the PR description as well: this PR currently supports Linux only, and macOS support is still separate WIP.

Please verify the build before calling a contribution "AI generated slop". I do use AI tooling, but this is a reproducible working build. An unverified accusation like that is human generated slop, not useful review feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a flake.nix for Nix users

3 participants